<?xml version="1.0" ?>
<nets>
  <% PNEngine::Petrinet.find(:all, :order => "id ASC").each do |net| %>
    <net>
      <instances>
        <% PNEngine::Token.find(:all, :order => "id ASC").select { |token| !token.place.nil? && token.place.petrinet == net }.collect { |token| token.case.id }.uniq.each do |case_id| %>
          <instance>
            <net_id><%= net.id %></net_id>
            <case_id><%= case_id %></case_id>
            <transition_count><%= PNEngine::CsvLogger.get_transition_count_for_case(case_id)%></transition_count>
            <duration><%= PNEngine::CsvLogger.get_time_period_for_case(case_id)%></duration>
            <involved_users_count><%= PNEngine::CsvLogger.get_involved_users_count_for_case(case_id)%></involved_users_count>
            <adhoc_order><%=  PNEngine::CsvLogger.get_adhoc_order(case_id)%></adhoc_order>
          </instance>
        <% end %>
      </instances>        
    </net>
  <% end %>
</nets>